﻿using System.Web.Mvc;

namespace SlamCms.Web.Mvc
{
	public class JavascriptEmbeddedHtmlViewResult : ContentResult
	{
		public JavascriptEmbeddedHtmlViewResult(string viewName, object model)
		{
			this.ViewName = viewName;
			this.Model = model;
		}

		public string ViewName { get; set; }
		public object Model { get; set; }

		public override void ExecuteResult(ControllerContext context)
		{
			var htmlString = context.RenderView(this.ViewName, this.Model, true);
			context.HttpContext.Response.Write(htmlString);
		}
	}
}
